<?php
namespace app\api\controller;

use think\Controller;
use think\Request;

class Image extends Controller
{
    public function upload(Request $request)
    {
        $file = $request->file('file');
        // 文件上传目录
        $info = $file->move('upload');
        if ($info && $info->getPathname())
        {
            return show(1, 'success', '/'.$info->getPathname());
        }
        return show(0, 'upload error');
    }
}